package org.sunon.dubbo.consumer;

import com.alibaba.dubbo.config.annotation.Reference;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.sunon.dubbo.api.HttpHandler;

@SpringBootApplication
@RestController
public class DubboConsumerApplication {

    @Reference
    private HttpHandler httpHandler;

    @RequestMapping("/dubbo/hello")
    public String sayHello() {
        return httpHandler.getHello();
    }

    public static void main(String[] args) {
        SpringApplication.run(DubboConsumerApplication.class, args);
    }
}
